<?php
	class hocky_monhocdata
	{				
		public function Them($hk_mh_mahocky = "", $hk_mh_mamonhoc = "")
		{
			$sql = "INSERT INTO hocky(hk_mh_mahocky, hk_mh_mamonhoc)
					VALUES('$hk_mh_mahocky', '$hk_mh_mamonhoc')";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function CapNhat($hk_mh_mahocky = "", $hk_mh_mamonhoc = "")
		{
			$sql = "UPDATE hocky SET hk_mh_mamonhoc = '$hk_mh_mamonhoc' WHERE hk_mh_mahocky = '$hk_mh_mahocky'";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function Xoa($hk_mh_mahocky = "")
		{
			$sql = "DELETE  FROM hocky WHERE hk_mh_mahocky = '$hk_mh_mahocky'";
			
			$service = new dataservice();
			return $service->ExecuteNonQuery($sql);
		}
		
		public function LayDanhSach($hk_mh_mahocky = "")
		{
			$sql = "SELECT * FROM hocky WHERE 1";
			
			if($hk_mh_mahocky != "")
				$sql .= " AND hk_mh_mahocky = '$hk_mh_mahocky'";
			
			$service = new dataservice();
			return $service->ExecuteQuery($sql);
		}
	}
?>